<?php

namespace app\api\controller\qsy;


use app\admin\model\qsy\Banner;
use app\admin\model\qsy\Indexbanner;
use app\admin\model\qsy\Other;
use app\admin\model\qsy\Story;
use app\common\controller\Api;
use app\common\helpers\ImageUtil;
use app\common\model\Config;

/**
 * 丘山阅首页
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    //轮播列表
    public function bannerList()
    {
        $list = Indexbanner::field('id,img')->where('status','1')->order('create_time desc')->limit(6)->select();
        if($list){
            foreach ($list as $v){
                $v['img'] = ImageUtil::handle($v['img']);
            }
        }
        $this->success('获取成功', $list);
    }

    //轮播详情
    public function bannerDetails()
    {
        $id = $this->request->param('id');
        $info = Indexbanner::where('id',$id)->find();
        if(!$info){
            $this->success("获取失败");;
        }
        $this->success('获取成功', $info);
    }

    

}
